﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HRIDAO;
using HRModel;
using HRDAO.EO;

namespace HRDAO
{
    public class StudentDAO : IStudentDAO
    {
        EFContext ef = new EFContext();

        public int Add(StudentDto sd)
        {
            //StudentDto转换为Student
           Student st= Configuration.Configure().Map<Student>(sd);
            ef.Students.Add(st);
            return ef.SaveChangesAsync().Result;
        }
    }
}
